
'''	
	This file is part of Arendal.

	Copyright (C) 2008	Mohamed Hazem <mohamed.hazem@student.guc.edu.eg>


	Arendal is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	Arendal is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Arendal.	If not, see <http://www.gnu.org/licenses/>.
'''


from PyQt4.QtCore import QVariant, Qt, SIGNAL, QString, QStringList
from PyQt4.QtSql import QSqlDatabase, QSqlQuery
from PyQt4.QtGui import QWidget, QApplication, QLineEdit, QHBoxLayout, QVBoxLayout, QLabel, QPushButton, QMessageBox, QGridLayout, QCompleter, QComboBox
from eventCreationWizard import eventCreationWizard
from updateProfileView import updateProfileForm
from manageEventsForm import manageEventsForm
from calendarWindow import calendarWindow

class userView(QWidget):
	def __init__(self, userID):
		QWidget.__init__(self)
		self.userID = userID
		print "userID is: " + str(self.userID)
		self.setWindowTitle("User View")

		self.newEventButton = QPushButton("Create New Event")
		self.updateProfileButton = QPushButton("Update Profile")
		self.manageEventsButton = QPushButton("Manage Events")
		self.searchEventsButton = QPushButton("Search Events")
		self.calendarButton = QPushButton("Calendar View")

		self.connect(self.newEventButton, SIGNAL("clicked()"), self.runEventCreationWizard)
		self.connect(self.updateProfileButton, SIGNAL("clicked()"), self.updateProfile)
		self.connect(self.manageEventsButton, SIGNAL("clicked()"), self.manageEvents)
		self.connect(self.calendarButton, SIGNAL("clicked()"), self.calendarWindow)

		self.grid = QGridLayout()
		self.grid.addWidget(self.newEventButton)
		self.grid.addWidget(self.updateProfileButton)
		self.grid.addWidget(self.manageEventsButton)
		self.grid.addWidget(self.calendarButton)

		self.setLayout(self.grid)

		self.show()
		
	def runEventCreationWizard(self):
		self.eventWizard = eventCreationWizard(self.userID)

	def updateProfile(self):
		self.updateProfilePage = updateProfileForm(self.userID)

	def manageEvents(self):
		self.manageEventsWindow = manageEventsForm(self.userID)

	def calendarWindow(self):
		self.calWindow = calendarWindow(self.userID)